package com.iuv.shortmsgnotice.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class IuvDateUtil
{
	public static final String DATE_FORMAT = "yyyy-MM-dd";
	public static final String DATE_FORMAT_S = "yyyy-MM-dd'T'";
	public static final String TIME_FORMAT = "HH:mm:ss";
	public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
	public static final String DATE_TIME_FORMAT_S = "yyyy-MM-dd'T'HH:mm:ss'Z'";
	public static final String TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss SSS";
	public static final String DATE_TIME_STRING = "yyyy-MM-dd_HH-mm-ss-SSS";
	public static final String DATE_TIME_FORMAT_1 = "yyyy-MM-dd HH:mm";


	public static String formatDateDefault(Date date)
	{
		return formatDate(date, DATE_FORMAT);
	}

	public static String formatDate(Date date, String formatType)
	{
		String dateStr = null;
		if (date != null)
		{
			SimpleDateFormat formater = new SimpleDateFormat(formatType);
			dateStr = formater.format(date);
		}
		return dateStr;
	}

}
